#pragma once

#include "funpl.h"

namespace funpl
{

namespace debug
{

/// Error codes.
namespace error_code
{
	/// Enumeration.
	enum t
	{
		unexpected_token = 4000,
		invalid_num_literal = 4001
	};
}

/// Error information.
struct error
{
	error_code::t code;
	std::string msg;

	size_t line;
	size_t pos;

	/// Constructor.
	error(error_code::t code, const char *msg, size_t line, size_t pos)
		: code(code),
		msg(msg),
		line(line),
		pos(pos) { }
};

/// Errors.
struct error_info
{
	typedef std::vector<debug::error> error_vector;
	error_vector errors;
	error_vector warnings;
};

/// Gets the name of the given error code.
const char* error_name(error_code::t error);

} // namespace

} // namespace